import { request } from '@/base/Request';
import { ModelSelfMotion } from '@/base/model/ModelSelfMotion'
import qs from 'qs'

export function postModelSelfMotion(params: {
  selfMotion: string,
  selfMotionEnglish: string,
  selfMotionId: number,
  deviceModelId: number,
}) {
  console.log(params);
  return request.post(ModelSelfMotion, '/api/model-self-motion', qs.stringify(params))
}

export function getModelSelfMotion(params: {
  pageIndex: number,
  pageSize: number,
  sortDirection: string,
  selfMotion?: string,
  selfMotionEnglish?: string,
  deviceModelId: number
}) {
  return request.getPage(ModelSelfMotion, '/api/model-self-motion', { params })
}


export function getModelSelfMotionId(
  id: number
) {
  return request.get(ModelSelfMotion, `/api/model-self-motion/${id}`)
}

export function PutModelSelfMotion(params: {
  id: number,
  selfMotion: string,
  selfMotionEnglish: string,
  selfMotionId: number,
  deviceModelId: number
}) {
  return request.put(ModelSelfMotion, `/api/model-self-motion`, qs.stringify(params))
}

export function deleteModelSelfMotionId(
  id: number
) {
  return request.delete(`/api/model-self-motion/${id}`)
}